﻿using System;
using System.Configuration;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Net.Mail;

namespace ECSE6770
{
    public class NotificationManager
    {
        public static string FromEmail
        {
            get { return ConfigurationManager.AppSettings["FromEmail"]; }
        }

        public static string SiteUrl
        {
            get { return ConfigurationManager.AppSettings["SiteUrl"]; }
        }

        public static string ContactEmail
        {
            get { return ConfigurationManager.AppSettings["ContactEmail"]; }
        }

        public static void NotifyRegistration(string user, string password, string email)
        {
            new SmtpClient().Send(
                    new MailMessage(FromEmail, email, "Global Advantage Account Creation",
                        String.Format("A new Global Advantage account has been created on your behalf.\r\n\r\nPlease use the following information to log in at {0} :\r\nUser name: {1}\r\nPassword: {2}\r\n\r\nIf you believe this is a mistake, please contact {3}.", SiteUrl, user, password, ContactEmail)));
        }
    }
}